extends Control
signal camera_change

# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var warp
var list

# Called when the node enters the scene tree for the first time.
func _ready():
	warp = get_node("CanvasLayer/HSlider/Label")
	list = get_node("CanvasLayer/ItemList")
	warp.text = "Timewarp! (" + str(Global.timewarp) + "x)"
	for child in Global.objects:
		list.add_item(child.name)
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#	pass


func _on_HSlider_value_changed(value):
	Global.timewarp = pow(10,value)
	warp.text = "Timewarp! (" + str(Global.timewarp) + "x)"
	pass # Replace with function body.


func _on_ItemList_item_selected(index):
	emit_signal("camera_change",list.get_item_text(index))
	pass # Replace with function body.
